Previous Book Contents Book Index Next

Inside Macintosh: QuickTime Components /
Chapter 4 - Image Compressor Components / Image Compressor Components Reference
Functions / Direct Functions


CDGetMaxCompressionSize

Your component receives the CDGetMaxCompressionSize request whenever an application calls the Image Compression Manager's GetMaxCompressionSize function. The caller uses this function to determine the maximum size the data will become for a given parameter.

pascal ComponentResult CDGetMaxCompressionSize (PixMapHandle src,
                                              const Rect *srcRect,
                                              short depth,
                                              CodecQ quality, 
                                              long *size);
src
Contains a handle to the source image. The source image is stored in a pixel map structure. Applications use the size information you return to allocate buffers that may be used for more than one image. Consequently, your compressor should not consider the contents of the image when determining the maximum compressed size. Rather, you should consider only the quality level, pixel depth, and image size.
This parameter may be set to nil. In this case the application has not supplied a source image--your component should use the other parameters to determine the characteristics of the image to be compressed.
srcRect
Contains a pointer to a rectangle defining the portion of the source image to compress.
depth
Specifies the depth at which the image is to be compressed. Values of 1, 2, 4, 8, 16, 24, and 32 indicate the number of bits per pixel for color images. Values of 33, 34, 36, and 40 indicate 1-bit, 2-bit, 4-bit, and 8-bit grayscale, respectively, for grayscale images.
quality
Specifies the desired compressed image quality. See the chapter "Image Compression Manager" in Inside Macintosh: QuickTime for valid values.
size
Contains a pointer to a field to receive the maximum size, in bytes, of the compressed image.
DESCRIPTION
Your component returns a long integer indicating the maximum number of bytes of compressed data that results from compressing the specified image.

Only compressors receive this request.

RESULT CODES
noErr0No error
paramErr-50Invalid parameter specified

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996